﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace ProjetoFinal
{
    public class CollisionManager
    {
      
        public void Collision(Leaf leaf, Monkey monkey)
        {
            if (monkey.rectDestination.Intersects(leaf.rectCollision))
            {
                monkey.jumpSound.Play();
                monkey.rectDestination.Y = leaf.rectCollision.Y - monkey.rectDestination.Height;
                monkey.speed.Y *= -1;
                monkey.animation = true;
                monkey.teste = true;
                monkey.rectSource.X = 0;
                monkey.NFrame = 1;

            }


        }

    }

}
